<?php

/**
 * Answer form.
 *
 * @package    tests
 * @subpackage form
 * @author     Djul
 */
class DoanswerForm extends BaseForm
{
  public function configure()
  {
    $this->widgetSchema['id'] = new sfWidgetFormInputHidden();
    $this->validatorSchema['id'] = new sfValidatorInteger(array('required' => true));
    $this->setDefault('id', $this->getOption('id'));
    $c = new Criteria();
    $c->add(AnswerPeer::QUESTION_ID, $this->getOption('id'));
    $this->widgetSchema['answer_list'] = new sfWidgetFormPropelChoice(array('model' => 'Answer','expanded' => true, 'multiple' => $this->getOption('mylti'),'criteria' => $c));
    $this->validatorSchema['answer_list'] = new sfValidatorPropelChoice(array('model' => 'Answer', 'required' => true, 'criteria' => $c, 'multiple' => $this->getOption('mylti')));

    $this->widgetSchema->setNameFormat('Doanswer[%s]');
  }
}
